{% extends "layout/basic.html" %}
{% import "components/contest.html" as contest with context %}
{% import "components/problem.html" as problem with context %}
{% block content %}
{{ set(UiContext, 'tdoc', tdoc) }}
<div class="row">
  <div class="medium-9 columns">
    <div class="section">
      <div class="section__body no-padding">
        <table class="data-table">
          <colgroup>
            <col class="col--id">
            <col class="col--problem">
            <col class="col--score">
          </colgroup>
          <thead>
            <tr>
              <th class="col--id">{{ _('ID') }}</th>
              <th class="col--problem">{{ _('Problem') }}</th>
              <th class="col--score">{{ _('Score') }}</th>
            </tr>
          </thead>
          <tbody>
          {%- for pid in tdoc.pids -%}
            <tr>
              <td class="col--id">{{ pdict[pid].docId }}</td>
              <td class="col--problem col--problem-name">
                <a href="{{ url('problem_detail', pid=pid) }}">
                  {{ problem.render_problem_title(pdict[pid], tdoc=tdoc, invalid=true, alphabetic=true) }}
                </a>
              </td>
              <td class="col--score">
                <a class="typo-a" data-tooltip="{{ _('Set Score for Contest') }}" name="set_score" data-pid="{{ pid }}" data-score="{{ tdoc.score[pid]|default(100) }}">{{ tdoc.score[pid]|default(100) }}</a>
              </td>
            </tr>
          {%- endfor -%}
          </tbody>
        </table>
      </div>
    </div>
    <div class="row">
      <div class="medium-6 columns">
        <div class="section" data-type="public">
          <div class="section__header">
            <h1 class="section__title">{{ _('Files') }}({{ _('Public') }})</h1>
            <div class="section__tools">
              <button class="primary rounded button" name="upload_file">{{ _('Upload File') }}</button>
            </div>
          </div>
          {{ noscript_note.render() }}
          {% set filetype = "public" %}
          {% include "partials/files.html" %}
          <div class="section__body">
            <button class="rounded button" name="remove_selected">{{ _('Remove Selected') }}</button>
          </div>
        </div>
      </div>
      <div class="medium-6 columns">
        <div class="section" data-type="private">
          <div class="section__header">
            <h1 class="section__title">{{ _('Materials') }}({{ _('Only Partic.') }})</h1>
            <div class="section__tools">
              <button class="primary rounded button" name="upload_file">{{ _('Upload File') }}</button>
            </div>
          </div>
          {% set files = privateFiles %}
          {% set filetype = "private" %}
          {% include "partials/files.html" %}
          <div class="section__body">
            <button class="rounded button" name="remove_selected">{{ _('Remove Selected') }}</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="medium-3 columns">
    {% include 'partials/contest_sidebar_management.html' %}
  </div>
</div>
{% endblock %}
